package common;

import java.util.Collection;

public class HirelessRoomPartTag extends PartTag {
	private int lines;
	private String section;
	private String building;
	private String roomType;
	private String area;
	
	protected void initParamPrefix() {
   		 prefix = "room_";
  	}
  	
  	public void setLines(String linesTemp) {
  		
  		if (linesTemp.equals(""))
  			linesTemp = "0";
  		try {
  			lines = Integer.parseInt(linesTemp);
  		} catch (Exception e) {
  			System.out.println("roomPartttag : ");
  			lines = 0;
  		}
  				
  	}	
  	
  	public void setSection(String sectionTemp) {
  		section = sectionTemp;
  	}	
  	
  	public void setBuilding(String buildTemp) {
  		building = buildTemp;
  	}	
  	
  	public void setRoomType(String setValue) {
  		roomType = setValue;
  	}	
  	
  	public void setArea(String setValue) {
  		area = setValue;
  	}	
  	
	//protected Collection findCollection() throws Exception {
	protected SelectedPart findPart() throws Exception {
		
        	System.out.println("roomparttag findcollection ");
        	HirelessRoomList roomList = new HirelessRoomList();
        	SelectedPart  part = null;
        	//Collection rooms = null;
       	        part = roomList.getRooms(pageIndex,10,section,building,roomType,area);    //pageindex = 1 , pagesize =10
                return part;
                //getNavInfo(part);
                //rooms = part.getCollection();
                //allLines = part.getAll();
              	//pageIndex = part.getIndex();
                //pageSize = part.getSize();
                //factSize = part.getSelect();
                //int pages = allLines / pageSize;
                //int odd = allLines % pageSize;
                //if (odd > 0) 
                //	pages += 1;
                //System.out.println("odd : " + odd);
                //System.out.println("allLines : " + allLines + ":" + pages + " : " + pageSize + " : " + pageIndex);
                //if (pageIndex < pages)
    		//	 hasNext = true;
    		//else hasNext = false;
    		//System.out.print("hasnext" + hasNext);
    		//return(rooms);
  	}
}	